<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Editor</title>
<script language="javascript" type="text/javascript" src="../../tinyfck/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
    tinyMCE.init({
        mode : "textareas",
        plugins : "style,table,advhr,advimage,advlink,emotions,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable",
        theme_advanced_buttons1_add_before : "save,newdocument,separator",
        theme_advanced_buttons1_add : "fontselect,fontsizeselect",
        theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",
        theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
        theme_advanced_buttons3_add_before : "tablecontrols,separator",
        theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_path_location : "bottom",
        content_css : "/example_data/example_full.css",
        plugin_insertdate_dateFormat : "%d-%m-%Y",
        plugin_insertdate_timeFormat : "%H:%M:%S",
        extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
        external_link_list_url : "example_data/example_link_list.js",
        external_image_list_url : "example_data/example_image_list.js",
        flash_external_list_url : "example_data/example_flash_list.js",
        file_browser_callback : "fileBrowserCallBack",
        theme_advanced_resize_horizontal : false,
        theme_advanced_resizing : true,
        apply_source_formatting : true
        //language : "zh_cn_utf8"
    });
        
    function fileBrowserCallBack(field_name, url, type, win) {
        var connector = "../../filemanager/browser.html?Connector=connectors/jsp/connector";
        var enableAutoTypeSelection = true;
 
        var cType;
        tinyfck_field = field_name;
        tinyfck = win;
    
        switch (type) {
            case "image":
                cType = "Image";
                break;
            case "flash":
                cType = "Flash";
                break;
            case "file":
                cType = "File";
                break;
        }
    
        if (enableAutoTypeSelection && cType) {
            connector += "&Type=" + cType;
        }
        window.open(connector, "tinyfck", "modal,width=600,height=400");
    }
</script>
</head>
<body>
<f:view>
<h:messages showDetail="true" showSummary="false" ></h:messages>
<h:form   rendered="true" id="manterNoticia" >
 <table>
   <tr>
   <td>Titulo</td>
   <td>
   <h:inputText id="Titulo" value="#{manterNoticia.noticia.titulo}" required="true" />
 </td>
 </tr> 
   <tr>
   <td>Chamada</td>
   <td>
   <h:inputText value="#{manterNoticia.noticia.chamada}"/>
 </td>
 </tr> 
   <tr>
   <td>Fonte</td>
   <td>
   <h:inputText value="#{manterNoticia.noticia.fonte}"/>
 </td>
 </tr> 
   <tr>
   <td>Conteudo</td>
   <td>
   <h:inputTextarea id="news_content" style="width: 650px; height: 400px" value="#{manterNoticia.noticia.conteudo}"  ></h:inputTextarea>
    <!--   <textarea id="news_content" name="news_content" style="width: 650px; height: 400px"></textarea> -->
   </td>
   </tr>
   <tr>
   <td colspan="2" align="center">
   <h:commandButton action="#{manterNoticia.inserir}" value="Inserir"  rendered="true"></h:commandButton>
   </td>
   
   </tr>
   </table> 
</h:form>
</f:view> 
</body>
</html>